<script lang="ts" setup>
const loginOut = () => {
  localStorage.removeItem("token");
  localStorage.removeItem("userName");
  window.location.href = "/login";
};
</script>

<template>
  <div class="toolbar">
    <el-dropdown placement="bottom">
      <img
        style="width: 40px; height: 40px; border-radius: 50%"
        src="@/assets/userInfo/headerImg.png"
        alt="头像图片"
      />
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item>个人设置</el-dropdown-item>
          <el-dropdown-item>修改密码</el-dropdown-item>
          <el-dropdown-item @click="loginOut">退出登录</el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>
  </div>
</template>

<style lang="less" scoped>
.toolbar{
  height: 100%;
  padding-top: 10px;
}
</style>
